package me.dqn.floatingtraffic.service;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;
import me.dqn.floatingtraffic.R;

public class ProtectBroadcast extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        if (intent.getAction().equals(context.getString(R.string.BACK_SERVICE_NAME))) {
            Toast.makeText(context, "Traffic Service Restarting..", Toast.LENGTH_SHORT).show();
            Intent intentStart = new Intent();
            intentStart.setClass(context, BackService.class);
            context.startService(intent);
        }
    }
}
